package com.smarttest.common.util.protocol;

import net.jpountz.lz4.LZ4Compressor;
import net.jpountz.lz4.LZ4Factory;
import net.jpountz.lz4.LZ4SafeDecompressor;

public class LZ4CompressorUtil {
	//LZ4解压
	private static LZ4SafeDecompressor decompressor=LZ4Factory.fastestInstance().safeDecompressor();
	//LZ4压缩
	private static LZ4Compressor compressor=LZ4Factory.fastestInstance().fastCompressor();
	
	public static byte[] decompressLZ4(byte[] data){
	    	byte[] value = decompressor.decompress(data, 1024);
	    	return value;   	
	}
    public static byte[] compressLZ4(byte[] data){
    	byte[] value =compressor.compress(data);
    	return value;   	
    }
}
